package com.tledu.springboots01.controller;

import com.tledu.springboots01.model.User;
import com.tledu.springboots01.service.IUserService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.jws.WebParam;
import java.util.List;

/**
 * @author Lsj
 * @version 1.0
 * @date 2021/6/30 20:10
 */
@Controller
@AllArgsConstructor
@RequestMapping("/user")
public class UserController {
    private final IUserService userService;
    @RequestMapping("list")
    public String list(Model model){
        List<User> list = userService.list();
        model.addAttribute("list",list);
        return "user/list";
    }
}
